package com.peanut.devlibrary.camera;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;

import com.peanut.baby.R;


public class FocusRectangle extends View {

	public FocusRectangle(Context context, AttributeSet attrs) {
		super(context, attrs);
	}

	@SuppressWarnings("deprecation")
	private void setDrawable(int resid) {
		setBackgroundDrawable(getResources().getDrawable(resid));
	}

	public void showStart() {
		setDrawable(R.drawable.library_focusing);
	}

	public void showSuccess() {
		setDrawable(R.drawable.library_focused);
	}

	public void showFail() {
		setDrawable(R.drawable.library_focus_failed);
	}

	@SuppressWarnings("deprecation")
	public void clear() {
		setBackgroundDrawable(null);
	}

}
